package day05;

import java.util.Arrays;

public class ArrayDemo {
    public static void main(String[] args) {

//        int [] arr1  = new int[5];
//
//        double[] arr2 = new double[10];
//
//        boolean[] arr3 = new boolean[26];
//
//        int[] arr4 = new int[]{2,5,8};
//
//        int[] arr = new int[10];
//        for (int i = 0 ; i<arr.length ; i++){
//            arr[i] = (int)(Math.random()*100);
//            System.out.println(arr[i]);
//        }

        int[] a = {10, 20, 30, 40, 50};
        int[] b =   Arrays.copyOf(a,a.length+1);

        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]);
        }



//        double[] arrd = new double[10];
//        for (int i = 0 ; i<arrd.length ; i++){
//            arrd[i] = Math.random()*100;
//            System.out.println(arrd[i]);
//        }


//        System.out.println("数组的长度:" + arr.length);
//        System.out.println(arr[0]);
//        arr[0] = 100;
//        arr[1] = 200;
//        arr[2] = 300;
//        arr[3] = 400;
//
//        System.out.println(arr[2]);
//        System.out.println(arr[arr.length-1]);





    }
}
